<?php
namespace App\Controller\Admin;

use App\Query\MallShopQuery;
use App\Repository\MallShopRepository;

class MallShopController extends Controller
{
    // 列表
    public function index()
    {
        return MallShopQuery::query(
            MallShopQuery::model(),
            $this->inputs('status')
        )->paginate(15)->toArray();
    }
    
    // 修改
    public function update($id)
    {
        $model = MallShopRepository::find($id);
        
        // 成功
        if($model && $model->save($this->inputs('name', 'content', 'status')))
        {
            $this->message('ok');
        }
        
        $this->error('error');
    }
}